package com.design.pattern.behaviour.templateMethod;

/**
 * 试卷父类
 * @Author hanyuanlai
 * @Date 2022/7/25
 */
public abstract class TestPaper {
    public void answer() {
        question1();
        answer1();
        question2();
        answer2();
        question3();
        answer3();
    }

    protected abstract void answer1();
    protected abstract void answer2();
    protected abstract void answer3();

    private void question3() {
        System.out.println("葡萄英语:___");
    }
    private void question2() {
        System.out.println("香蕉英语:___");
    }

    private void question1() {
        System.out.println("苹果英语:___");
    }
}
